package com.sd365.permission.centre.api;

import com.sd365.permission.centre.pojo.dto.AdministrativeDTO;
import com.sd365.permission.centre.pojo.query.AdministrativeQuery;
import com.sd365.permission.centre.pojo.query.IdVersionQuery;
import com.sd365.permission.centre.pojo.vo.AdministrativeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

@CrossOrigin
@Api(tags = "行政区划 ", value = "/permission/centre/v1/administrative")
@RequestMapping(value = "/permission/centre/v1/administrative")
public interface AdministrativeApi {

    /**
     * @param: 区域DTO
     * @return: 成功则true CommonResponse 应答码和消息统一参考基础框架
     * @see
     * @since
     */

    @ApiOperation(tags = "增加区域", value = "/add")
    @PostMapping(value = "/add")
    @ResponseBody
    Boolean add(@RequestBody @Valid AdministrativeDTO administrativeDTO);


    /**
     * @param: 删除区域
     * @return: 成功则true CommonResponse 应答码和消息统一参考基础框架
     * @see
     * @since
     */
    @ApiOperation(tags = "删除区域", value = "")
    @DeleteMapping(value = "/delete")
    @ResponseBody
    Boolean remove(@ApiParam(value = "当前行id", required = true) @RequestParam("id") Long id,
                   @ApiParam(value = "当前行版本", required = true) @RequestParam("version") Long version);


    /**
     * @param: 区域DTO
     * @return: 成功则true CommonResponse 应答码和消息统一参考基础框架
     * @see
     * @since
     */
    @ApiOperation(tags = "修改区域", value = "")
    @PutMapping(value = "/modify")
    @ResponseBody
    Boolean modify(@Valid @RequestBody AdministrativeDTO administrativeDTO);


    /**
     * @param: 区域查询条件
     * @return: 用户VO
     * @see
     * @since
     */

    @ApiOperation(tags = "查询区域", value = "")
    @GetMapping(value = "")
    @ResponseBody
    List<AdministrativeVO> commonQuery(AdministrativeQuery administrativeQuery);


    /**
     * @param: 区域ID
     * @return: 区域VO
     * @see
     * @since
     */
    @ApiOperation(tags="查询区域通过id",value="")
    @GetMapping(value = "/{id}")
    @ResponseBody
    AdministrativeVO selectById(@PathVariable("id") Long id);
//    /**
//     * @param: 区域ID
//     * @return: 区域VO
//     * @see
//     * @since
//     */
//    @ApiOperation(tags="查询区域通过type",value="")
//    @GetMapping(value = "/selectByType/{type}")
//    @ResponseBody
//    AdministrativeVO selectByType(@PathVariable("type") String type);

    /**
     * @param: 用户DTO数组
     * @return: 成功则true CommonResponse 应答码和消息统一参考基础框架
     * @see
     * @since
     */
    @ApiOperation(tags="批量删除区域",value="")
    @DeleteMapping(value = "/batch")
    @ResponseBody
    Boolean batchDelete( @Valid @RequestBody  List<IdVersionQuery> idVersionQueryList);
    /**
     * 更新单条启用状态
     * @param administrativeDTO
     * @return
     */
    @ApiOperation(tags = "修改状态", value = "/status")
    @PutMapping(value = "/status")
    @ResponseBody
    Boolean status(@RequestBody AdministrativeDTO administrativeDTO);
}
